package com.wyd.qxglmybatis.controller;

import javax.annotation.Resource;

import com.wyd.qxglmybatis.service.IRoleUserService;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/user_role")
public class RoleUserController {


     @Resource
    private IRoleUserService roleUserService;

    @ApiOperation(value = "给用户授予角色",notes = "给用户授予角色")
 
    @ApiImplicitParams({
        @ApiImplicitParam(name="user_id",value ="用户id",required=true,paramType ="path"),
        @ApiImplicitParam(name="role_id",value ="角色id",required=true,paramType ="path")
       

    })
    @PostMapping(value = "/add/{user_id}/{role_id}")
    public void add(@PathVariable String user_id,@PathVariable String[]  role_id){

         roleUserService.addUsersRoles(user_id,role_id);

    } 

}